
#ifndef TASKLIST_H
#define TASKLIST_H

#include <QObject>
#include <QTreeWidget>

#include "task.h"

namespace Wishmaster
{
	class Taskhub;
}

// have to do it because of qt signal/slot-namespace bug
using namespace Wishmaster;

class TaskList : public QTreeWidget
{
	Q_OBJECT
public:
	TaskList(Wishmaster::Taskhub* hub, QWidget* parent = 0);
	virtual ~TaskList();

public slots:
	void taskProgress(int id, int percentage);
	void taskDone(TaskPtr task);
	void refill();

private slots:
	void cancel();

private:
	void addTask(Wishmaster::TaskPtr task);
	Wishmaster::Taskhub* m_hub;

	static const int TaskIdRole = Qt::UserRole + 1;
};

#endif

